package timer;

import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;
import javax.swing.Timer;


public class TimerTest {

  public static void main(String[] args) {
    ActionListener listener = new TimePrinter();
    Timer timer = new Timer(10000, listener);
    timer.start();

    JOptionPane.showMessageDialog(null, "Quit program?");
    System.exit(0);
  }

}


class TimePrinter implements ActionListener {

  public void actionPerformed(ActionEvent event) {
    Date now = new Date();
    System.out.println("At the tone, the time is " + now);
    System.out.print("\007");
    System.out.flush();
  }

}
